﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class TestListBox : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (lstMain.SelectedIndex > -1)
        {
            string s = lstMain.SelectedItem.Value;
            lstSelect.Items.Add(s);
            lstMain.Items.Remove(s);
        }

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        if (lstSelect.SelectedIndex > -1)
        {
            string s = lstSelect.SelectedItem.Value;
            lstMain.Items.Add(s);
            lstSelect.Items.Remove(s);
        }

    }


}